#include <ros/ros.h>
#include <std_srvs/Empty.h>

int main(int argc, char **argv) noexcept {
    ros::init(argc, argv, "parameter");
    ros::NodeHandle node_handle;

    int r, g, b;
    ros::param::get("/turtlesim/background_r", r);
    ros::param::get("/turtlesim/background_g", g);
    ros::param::get("/turtlesim/background_b", b);

    ROS_INFO("Background color: %d %d %d", r, g, b);

    ros::param::set("/turtlesim/background_r", 255);
    ros::param::set("/turtlesim/background_g", 255);
    ros::param::set("/turtlesim/background_b", 255);

    ros::param::get("/turtlesim/background_r", r);
    ros::param::get("/turtlesim/background_g", g);
    ros::param::get("/turtlesim/background_b", b);

    ROS_INFO("Background color: %d %d %d", r, g, b);

    ros::service::waitForService("/clear");
    ros::ServiceClient client = node_handle.serviceClient<std_srvs::Empty>("/clear");
    std_srvs::Empty srv;
    client.call(srv);

    sleep(1);

    return 0;
}
